﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="User" table="cmsUser">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Username" type="System.String">
      <column name="Username" not-null="true" />
    </property>
    <property name="Password" type="System.String">
      <column name="Password" not-null="true" />
    </property>
    <property name="Email" type="System.String">
      <column name="Email" not-null="true" />
    </property>
    <property name="Firstname" type="System.String">
      <column name="Firstname" not-null="false" />
    </property>
    <property name="Lastname" type="System.String">
      <column name="Lastname" not-null="false" />
    </property>
    <property name="Phone" type="System.String">
      <column name="Phone" not-null="false" />
    </property>
    <property name="Deleted" type="System.Boolean">
      <column name="Deleted" not-null="true" />
    </property>
    <property name="Created" type="System.DateTime">
      <column name="Created" not-null="true" />
    </property>
    <property name="FirstLogin" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="FirstLogin" />
    </property>
    <property name="LatestLogin" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="LatestLogin" />
    </property>
    <property name="ForceLogout" type="System.Boolean">
      <column name="ForceLogout" not-null="true" />
    </property>
    <bag name="Memberships" table="cmsMembership" mutable="true" cascade="all-delete-orphan" inverse="true">
      <cache usage="read-write" />
      <key>
        <column name="UserID" />
      </key>
      <one-to-many class="Membership" />
    </bag>
    <component name="DeliveryAddress" class="Address">
      <property name="StreetAddress" column="DeliveryStreetAddress" type="System.String" not-null="false" />
      <property name="PostalCode" column="DeliveryPostalCode" type="System.String" not-null="false" />
      <property name="Town" column="DeliveryTown" type="System.String" not-null="false" />
      <property name="Country" column="DeliveryCountry" type="System.String" not-null="false" />
    </component>
    <component name="InvoiceAddress" class="Address">
      <property name="StreetAddress" column="InvoiceStreetAddress" type="System.String" not-null="false" />
      <property name="PostalCode" column="InvoicePostalCode" type="System.String" not-null="false" />
      <property name="Town" column="InvoiceTown" type="System.String" not-null="false" />
      <property name="Country" column="InvoiceCountry" type="System.String" not-null="false" />
    </component>
  </class>
</hibernate-mapping>